﻿
using System;
using System.Drawing;
using MonoTouch.CoreGraphics;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using Beauty.Module.Pos;
namespace Beauty
{
	public partial class SeviceDetailVCtrl : UIViewController
	{
		public SeviceDetailVCtrl () : base ("SeviceDetailVCtrl", null)
		{
		}

		public override void DidReceiveMemoryWarning ()
		{
			// Releases the view if it doesn't have a superview.
			base.DidReceiveMemoryWarning ();
			
			// Release any cached data, images, etc that aren't in use.
		}

		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();


			 
			SecondView.Layer.BorderWidth = 1.0f;
			SecondView.Layer.BorderColor = UIColorExtensions.FromHexString ("#b2b2b2").CGColor;
			//SecondView.Layer.CornerRadius = 5.0f;
			SecondView.Layer.BackgroundColor = UIColorExtensions.FromHexString ("#ebeef0").CGColor;
		
		
			ThirdView.Layer.BorderWidth = 1.0f;
			ThirdView.Layer.BorderColor = UIColorExtensions.FromHexString ("#b2b2b2").CGColor;
			ThirdView.Layer.CornerRadius = 5.0f;


			btnSave.Layer.CornerRadius = 25.0f;
			btnSave.Layer.ShadowOpacity = 0.0f; 
			btnSave.Layer.BorderWidth = 1.0f;
			btnSave.Layer.BorderColor = UIColorExtensions.FromHexString ("#ff485f").CGColor;
			btnSave.Layer.BackgroundColor = UIColorExtensions.FromHexString ("#ebeef0").CGColor;

			lbTitle.Text = "Hair Cut $32.00";
			lbDescription.Text = "This is description for this item";
			lbItemDetail.Text = "Support Service : Wash,Blow Sett";

			var buttonSpecial = UIButton.FromType (UIButtonType.Custom);
			buttonSpecial.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_ic_check"), UIControlState.Normal);
			buttonSpecial.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close_ic_uncheck"), UIControlState.Selected);
			buttonSpecial.Frame = new RectangleF (262,79, 27, 27);
			buttonSpecial.TouchUpInside += (sender, e) => 
			{
				var uiButton = sender as UIButton;
				uiButton.Selected = !uiButton.Selected;

			};
			ThirdView.Add (buttonSpecial);

			var buttonSpring = UIButton.FromType (UIButtonType.Custom);
			buttonSpring.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_ic_check"), UIControlState.Normal);
			buttonSpring.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close_ic_uncheck"), UIControlState.Selected);
			buttonSpring.Frame = new RectangleF (462,79, 27, 27);
			buttonSpring.TouchUpInside += (sender, e) => 
			{
				var uiButton = sender as UIButton;
				uiButton.Selected = !uiButton.Selected;

			};
			ThirdView.Add (buttonSpring);

			var buttonChildren = UIButton.FromType (UIButtonType.Custom);
			buttonChildren.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_ic_check"), UIControlState.Normal);
			buttonChildren.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close_ic_uncheck"), UIControlState.Selected);
			buttonChildren.Frame = new RectangleF (657,79, 27, 27);
			buttonChildren.TouchUpInside += (sender, e) => 
			{
				var uiButton = sender as UIButton;
				uiButton.Selected = !uiButton.Selected;

			};
			ThirdView.Add (buttonChildren);

			var buttonCustome = UIButton.FromType (UIButtonType.Custom);
			buttonCustome.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_ic_check"), UIControlState.Normal);
			buttonCustome.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close_ic_uncheck"), UIControlState.Selected);
			buttonCustome.Frame = new RectangleF (814,79, 27, 27);
			buttonCustome.TouchUpInside += (sender, e) => 
			{
				var uiButton = sender as UIButton;
				uiButton.Selected = !uiButton.Selected;

			};
			ThirdView.Add (buttonCustome);


			var buttonVAT = UIButton.FromType (UIButtonType.Custom);
			buttonVAT.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_ic_check"), UIControlState.Normal);
			buttonVAT.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close_ic_uncheck"), UIControlState.Selected);
			buttonVAT.Frame = new RectangleF (657,307, 27, 27);
			buttonVAT.TouchUpInside += (sender, e) => 
			{
				var uiButton = sender as UIButton;
				uiButton.Selected = !uiButton.Selected;

			};
			ThirdView.Add (buttonVAT);


			var buttonExcise = UIButton.FromType (UIButtonType.Custom);
			buttonExcise.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_ic_check"), UIControlState.Normal);
			buttonExcise.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close_ic_uncheck"), UIControlState.Selected);
			buttonExcise.Frame = new RectangleF (814,307, 27, 27);
			buttonExcise.TouchUpInside += (sender, e) => 
			{
				var uiButton = sender as UIButton;
				uiButton.Selected = !uiButton.Selected;

			};
			ThirdView.Add (buttonExcise);

			var button10 = UIButton.FromType (UIButtonType.Custom);
			button10.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_ic_check"), UIControlState.Normal);
			button10.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close_ic_uncheck"), UIControlState.Selected);
			button10.Frame = new RectangleF (814,373, 27, 27);
			button10.TouchUpInside += (sender, e) => 
			{
				var uiButton = sender as UIButton;
				uiButton.Selected = !uiButton.Selected;

			};
			ThirdView.Add (button10);

			var buttonRegular = UIButton.FromType (UIButtonType.Custom);
			buttonRegular.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_ic_check"), UIControlState.Normal);
			buttonRegular.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close_ic_uncheck"), UIControlState.Selected);
			buttonRegular.Frame = new RectangleF (262,440, 27, 27);
			buttonRegular.TouchUpInside += (sender, e) => 
			{
				var uiButton = sender as UIButton;
				uiButton.Selected = !uiButton.Selected;

			};
			ThirdView.Add (buttonRegular);

			var buttonPremium = UIButton.FromType (UIButtonType.Custom);
			buttonPremium.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_ic_check"), UIControlState.Normal);
			buttonPremium.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close_ic_uncheck"), UIControlState.Selected);
			buttonPremium.Frame = new RectangleF (462,440, 27, 27);
			buttonPremium.TouchUpInside += (sender, e) => 
			{
				var uiButton = sender as UIButton;
				uiButton.Selected = !uiButton.Selected;

			};
			ThirdView.Add (buttonPremium);

			var buttonPartner15 = UIButton.FromType (UIButtonType.Custom);
			buttonPartner15.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_ic_check"), UIControlState.Normal);
			buttonPartner15.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close_ic_uncheck"), UIControlState.Selected);
			buttonPartner15.Frame = new RectangleF (657,440, 27, 27);
			buttonPartner15.TouchUpInside += (sender, e) => 
			{
				var uiButton = sender as UIButton;
				uiButton.Selected = !uiButton.Selected;

			};
			ThirdView.Add (buttonPartner15);

			var buttonPartner50 = UIButton.FromType (UIButtonType.Custom);
			buttonPartner50.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_ic_check"), UIControlState.Normal);
			buttonPartner50.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close_ic_uncheck"), UIControlState.Selected);
			buttonPartner50.Frame = new RectangleF (814,440, 27, 27);
			buttonPartner50.TouchUpInside += (sender, e) => 
			{
				var uiButton = sender as UIButton;
				uiButton.Selected = !uiButton.Selected;

			};
			ThirdView.Add (buttonPartner50);
			TextNumber.Layer.BorderWidth = 1.0f;

			TextNumber.Layer.BorderColor = UIColorExtensions.FromHexString ("#b2b2b2").CGColor;

			TextAreaInfo.Layer.BorderWidth = 1.0f;
			TextAreaInfo.Layer.BorderColor = UIColorExtensions.FromHexString ("#b2b2b2").CGColor;
			imPlus.Image = PosUtility.ImageFrom ("ic_plus");
			imMinus.Image = PosUtility.ImageFrom ("ic_minus");
			//imClose.Image = PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close");

			btnClose.SetImage (PosUtility.ImageFrom ("CreateNewJobshetVCtrl_bt_close"), UIControlState.Normal);
			btnClose.TouchUpInside += (object sender, EventArgs e) => {
				closePopup();
				
			
			};
			View.Add (btnClose);


			// Perform any additional setup after loading the view, typically from a nib.
		}

		void closePopup()
		{
			UIView.AnimateAsync (0.25, animation: () => {
				View.Transform = CGAffineTransform.MakeScale (1.3f, 1.3f);
				View.Alpha = 0f;
			});
		}

		public void showAnimation(){
			View.Transform = CGAffineTransform.MakeScale (1.3f, 1.3f);
			View.Alpha = 0;
			UIView.AnimateAsync (0.25f, animation: () => {
				View.Alpha = 1;
				View.Transform = CGAffineTransform.MakeScale(1,1);
			});
		}
	}
}

